<!--
 * @Author: liuzilong 1174782213@qq.com
 * @Date: 2023-11-08 14:50:22
 * @LastEditors: liuzilong 1174782213@qq.com
 * @LastEditTime: 2023-11-08 14:51:18
 * @FilePath: \bunny-shop\src\pages\index\components\CategoryPanel.vue
 * @Description:
 *
 * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
-->
<script setup lang="ts">
//
import type { CategoryItem } from '@/types/home'
defineProps<{ categoryList: CategoryItem[] }>()
</script>

<template>
  <view class="category">
    <navigator
      class="category-item"
      hover-class="none"
      url="/pages/index/index"
      v-for="item in categoryList"
      :key="item.id"
    >
      <image class="icon" :src="item.icon"></image>
      <text class="text">{{ item.name }}</text>
    </navigator>
  </view>
</template>

<style lang="scss" scoped>
/* 前台类目 */
.category {
  margin: 20rpx 0 0;
  padding: 10rpx 0;
  display: flex;
  flex-wrap: wrap;
  min-height: 328rpx;
  background-color: #f7f7f7;
  .category-item {
    width: 150rpx;
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;

    .icon {
      width: 100rpx;
      height: 100rpx;
    }
    .text {
      font-size: 26rpx;
      color: #666;
    }
  }
}
</style>
